﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%@ Import Namespace="ControlModule.Daos" %>
<%@ Import Namespace="ControlModule.Security" %>
<%
    if (Request.IsAuthenticated) {
%>
        Welcome <b><%= Html.Encode(/*Page.User.Identity.Name*/ MyMembershipProvider.GetCurrentUserInstance().FirstName + " " + MyMembershipProvider.GetCurrentUserInstance().LastName)%></b>!<br/>
       <% if(HttpContext.Current.User.IsInRole("STUDENT")){ %>
        <%= Html.Encode(GroupDao.GetGroupById((int) MyMembershipProvider.GetCurrentUserInstance().GroupId).Name) %> <%} %>
        [ <%= Html.ActionLink("Log Off", "LogOff", "Account") %> ]
<%
    }
    else {
%> 
        [ <%= Html.ActionLink("Log On", "LogOn", "Account") %> ]
<%
    }
%>
